<template>
  <div id="app">
    <el-tabs v-model="activeName" @tab-click="handleClick">
      <el-tab-pane :label="$t('DASHBOARD')" name="/"></el-tab-pane>
      <el-tab-pane :label="$t('ABOUT')" name="about"></el-tab-pane>
      <el-tab-pane :label="$t('SETTINGS')" name="settings"></el-tab-pane>
    </el-tabs>
    <router-view/>
  </div>
</template>

<script>
import methods from './common/services/methods'

export default {
  name: 'App',
  data() {
    return {
      activeName: 'dashboard'
    };
  },
  created: function () {
    let defaultLangKey = methods.getDefaultLanguage();
    this.$i18n.locale = defaultLangKey;
  },
  methods: {
    handleClick(tab, event) {
      this.$router.replace(this.activeName);
    }
  }
}
</script>

<style lang="scss">
#app {
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}
</style>
